package com.tyk.bookstore.back.logistics.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tyk.bookstore.back.logistics.model.enume.WaybillState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author tyk
 * @description 运单
 */

@Schema(name = "Waybill", description = "运单")
@TableName("waybill")
@Data
public class WaybillDo implements Serializable {
    @Serial
    private static final long serialVersionUID = 1;

    @Schema(description = "ID")
    @TableId("id")
    private Long id;

    @Schema(description = "物流单号")
    @TableField("tracking_no")
    private String trackingNo;

    @Schema(description = "会员ID")
    @TableField("member_id")
    private Long memberId;

    @Schema(description = "订单ID")
    @TableField("order_id")
    private Long orderId;

    @Schema(description = "仓库ID")
    @TableField("warehouse_id")
    private Long warehouseId;

    @Schema(description = "快递公司ID")
    @TableField("express_company_id")
    private Long expressCompanyId;

    @Schema(description = "货物重量[单位：克]")
    @TableField("weight")
    private Long weight;

    @Schema(description = "运费")
    @TableField("freight")
    private BigDecimal freight;

    @Schema(description = "状态[0已下单,1已接单,2已发货,3已揽件,4运输中,5派件中,6待签收,7已签收]")
    @TableField("state")
    private WaybillState state;

    @Schema(description = "寄件人所在区域ID")
    @TableField("sender_area_code")
    private Long senderAreaCode;

    @Schema(description = "寄件人姓名")
    @TableField("sender_name")
    private String senderName;

    @Schema(description = "寄件人电话")
    @TableField("sender_phone")
    private String senderPhone;

    @Schema(description = "寄件人地址")
    @TableField("sender_address")
    private String senderAddress;

    @Schema(description = "收件人所在区域ID")
    @TableField("cnee_area_code")
    private Long cneeAreaCode;

    @Schema(description = "收件人姓名")
    @TableField("cnee_name")
    private String cneeName;

    @Schema(description = "收件人电话")
    @TableField("cnee_phone")
    private String cneePhone;

    @Schema(description = "收件人地址")
    @TableField("cnee_address")
    private String cneeAddress;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
